import cgi
from google.appengine.ext import db
from google.appengine.api import urlfetch
from google.appengine.api import users
from google.appengine.ext.webapp import util
from google.appengine.ext.webapp import template
from google.appengine.ext import webapp

# project imports
from config import appsettings
from servlets.base_handler import BaseHandler
from model.blogpost import BlogPost

class WriteHandler(BaseHandler):
  template = "write.html"
  def get(self):
    self.fill_template()
  def post(self):
    blogPost = BlogPost()    
    blogPost.content = self.request.get('content')
    blogPost.author = self.request.get('author')
    blogPost.put()
    self.redirect("/")

